package com.cndw.kungfu.core;

import com.cndw.dao.jade.ShardStrategy;

public class PlayerIdShardStrategy implements ShardStrategy {


	public PlayerIdShardStrategy(int partitionCount) {

	}

	@Override
	public String calc(Object value) {
		if (value instanceof Number) {
			return Long.toString((((Number) value).longValue() / 1000) % 10);
		}
		return Integer.toString(value.hashCode() % 10);
	}

}
